/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package publisher;

import java.util.ArrayList;

/**
 *
 * @author jfernan
 */
public class Publisher implements IPublisher {

    ArrayList<Subscriber> list=new ArrayList<Subscriber>();


    public void add(Subscriber subscriber) {
        list.add(subscriber);
    }

    public void publish(String message) {

        for( Subscriber s: list )
           s.receive(message);
    }


}
